<template>
  <a-select style="width: 120px" :options="options" label-in-value v-model:value="value">
  </a-select>
</template>
<script lang="ts" >
// import { SelectTypes } from 'ant-design-vue';
import { ref, defineComponent, reactive } from 'vue';
import { useDeptStoreWithOut } from '/@/store/modules/dept';

interface Value {
  value?: string;
  label?: string;
}
export default defineComponent({
  setup() {
    let options: any = reactive([]);

    const getDetpList = async function () {
      const deptStore = useDeptStoreWithOut();
      try {
        // loading.value = true;
        const deptList: any = await deptStore.getDeptList({
          mode: 'none',
        });
        if (deptList) {
          for (let i = 0; i < deptList.length; i++) {
            options[i] = {
              value: deptList[i].name
            }
          }
        }
      } catch (error) {
        console.log(error);
      } finally {
      }
    };
    getDetpList()























    return {
      options,
      value: ref<Value>({ value: '请选择社团' }),
    };
  }
})
</script>

